<div class="infoBlock infoBlockComment">
<div class="infoBlockHeading"><span class="t">Comments</span></div>
<div class="infoBlockContent">

{literal}
<style type="text/css">
.listcomment {
	list-style: none;
	padding: 0px;
	margin: 0px;
	margin-bottom: 10px;
	border: 1px solid #CCC;
	border-bottom: 0px;
}
.listcomment li {
	padding: 10px;
	border-bottom: 1px solid #CCC;
}
.listcomment li span.name {
	font-weight: bold;
}
.listcomment li span.time {
	float: right;
}
.listcomment li p.cont {
	padding: 10px;
}
.addcomment {
	border: 1px solid #CCC;
	padding: 10px;
}
</style>
{/literal}

{if $CONTEXT.permission.listcomment == 1}
<div class="infoBlockItem">
<ul id="comments-listcomment" class="listcomment">
{section name=comment loop=$CONTENT.comments}
<li><span class="name">{$CONTENT.comments[comment].name}</span><span class="time">{$CONTENT.comments[comment].time}</span><p>{$CONTENT.comments[comment].content}</p></li>
{/section}
</ul>
</div>
{/if}

{if $CONTEXT.permission.addcomment == 1}
<div class="infoBlockItem">
<div class="addcomment">
<form name="commentform" method="post" id="comments-addcomment-form">
<input type="hidden" name="form" value="content_comment">
<input type="hidden" name="target" value="{$CONTENT.item.id}">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td class="fb"><label class="fb">Name</label>: </td>
    <td>{pp_inputtext name="field_author" value=$CONTENT.comment.author class="inputText2" require="true"}</td>
    <td></td>
  </tr>
  <tr>
    <td><label class="fb">Email</label>: </td>
    <td>{pp_inputtext name="field_email" value=$CONTENT.comment.email class="inputText2" require="true" valid="email"}</td>
    <td></td>
  </tr>
  <tr>
    <td><label class="fb">Telephone</label>: </td>
    <td>{pp_inputtext name="field_telephone" value=$CONTENT.comment.telephone class="inputText2"}</td>
    <td></td>
  </tr>
  <tr>
    <td><label class="fb">Content</label>: </td>
    <td>{pp_inputtextarea name="field_content" value=$CONTENT.comment.content class="inputTextarea3"}</td>
    <td></td>
  </tr>
  <tr>
    <td><label class="fb">Captcha</label>: </td>
    <td><img src="{$CONTEXT.URL}check/code" width="120" height="40" title="Captcha" id="dimg_captcha">&nbsp;
    <a href="javascript:void(0);" onclick="_captcha_refresh()">Refresh</a>
    <p class="desc">Write the characters in the image above</p>
    <input type="text" name="checkcode" value="" size="5" maxlength="4" require="true"></td>
    <td></td>
  </tr>
  <tr>
    <td align="right" valign="top"></td>
    <td><input type="submit" name="submitbtn" value="Submit" onclick="return comment_add(this.form);return false;"></td>
    <td></td>
  </tr>
</table>
</form>
</div>
</div>
{/if}

{pp_js file="pjs.ws.js,comment.js"}
{literal}
<script type="text/javascript" language="javascript">
addLoadEvent(function(){comment_register(document.commentform);});
function _captcha_refresh(){
$E('dimg_captcha').src=PJS.BASE_URL+"check/code"+"/"+PJS.rand("t");
}
</script>
{/literal}

</div>
</div>